<template>
    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="item in cpImg">
            <img :src="item" />
        </van-swipe-item>
    </van-swipe>
    <h4> {{ cpData.proname }} </h4>
    
</template>
<script setup lang="ts">
// pinia内部方法用于解构(避免失去响应式)
import { storeToRefs } from 'pinia'
// 导入 pinia
import { useProductStore } from '../stores/product'
const store = useProductStore()
const { cpData, cpImg } = storeToRefs(store)

</script>

<style scoped>
.van-swipe {
    height: 250px;
}

.van-swipe img {
    width: 100%;
}
</style>